﻿CREATE FUNCTION dbo.ExtentedPriceAndAmount
(
	@basePrice DECIMAL(19, 2)
	,@commission DECIMAL(4, 2)
	, @quantity INT
)
RETURNS @result TABLE
(
	ExtendedPrice DECIMAL(19, 2)
	,Amount DECIMAL(19, 2)
)
WITH SCHEMABINDING
AS
BEGIN
	DECLARE @extendedPrice AS DECIMAL(19, 2) = @basePrice * (1.00 + @commission/100.00) 
	INSERT @result
	SELECT @extendedPrice, @extendedPrice * @quantity
	RETURN
END
